﻿using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using static CoreLims.Models.CoreLims.Env;
using static CoreLims.Models.CoreLims.Reagent;
using static CoreLims.Models.CoreLims.SPL;

#nullable disable

namespace CoreLims.Models.CoreLims
{
    public partial class CoreLimsContext : IdentityDbContext
    {
        protected string connectionString;
        public CoreLimsContext()
        {
        }
        public CoreLimsContext(DbContextOptions<CoreLimsContext> options)
            : base(options)
        {
        }
        public CoreLimsContext(string ConnectionString)
        {
            connectionString = ConnectionString;
        }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
                optionsBuilder.UseSqlServer(connectionString);
            }
        }

        public virtual DbSet<AuditAuditTrail> AuditTrail { get; set; }
        public virtual DbSet<AreaAndLocation> AreaAndLocation { get; set; }
        public virtual DbSet<CommonConversionFactor> ConversionFactor { get; set; }
        public virtual DbSet<Monitoring> Monitoring { get; set; }
        public virtual DbSet<MonitoringRecord> MonitoringRecord { get; set; }
        public virtual DbSet<CommonGlobal> Global { get; set; }
        public virtual DbSet<CommonGroupUser> GroupUser { get; set; }
        public virtual DbSet<Remind> Remind { get; set; }
        public virtual DbSet<CommonSiteGroup> SiteGroup { get; set; }
        public virtual DbSet<CommonStorageCondition> StorageCondition { get; set; }
        public virtual DbSet<CommonSupplier> Supplier { get; set; }
        public virtual DbSet<CommonUnit> Unit { get; set; }
        public virtual DbSet<CommonUser> User { get; set; }
        public virtual DbSet<CommonUploadFile> UploadFile { get; set; }
        public virtual DbSet<EqEquipment> Equipment { get; set; }
        public virtual DbSet<EqEquipmentInfo> EquipmentInfo { get; set; }
        public virtual DbSet<EqMaintain> Maintain { get; set; }
        public virtual DbSet<EqMaintainEvent> MaintainEvent { get; set; }
        public virtual DbSet<EqUsageRecord> UsageRecord { get; set; }
        public virtual DbSet<Inventory> Inventory { get; set; }
        public virtual DbSet<Material> Material { get; set; }
        public virtual DbSet<InventoryEx> InventoryEx { get; set; }
        public virtual DbSet<UseInventory> UseInventory { get; set; }
        public virtual DbSet<Component> Component { get; set; }
        public virtual DbSet<Reagents> Reagents { get; set; }
        public virtual DbSet<Record> Record { get; set; }
        public virtual DbSet<SampleAnalyte> Analyte { get; set; }
        public virtual DbSet<SampleLoginRelation> LoginRelation { get; set; }
        public virtual DbSet<SampleMethod> Method { get; set; }
        public virtual DbSet<SampleRelation> Relation { get; set; }
        public virtual DbSet<SampleResult> Result { get; set; }
        public virtual DbSet<RetentionConfig> RetentionConfig { get; set; }
        public virtual DbSet<RetentionSample> RetentionSample { get; set; }
        public virtual DbSet<RetentionUse> RetentionUse { get; set; }
        public virtual DbSet<SampleSample> Sample { get; set; }
        public virtual DbSet<SampleSampleBatch> SampleSampleBatch { get; set; }
        public virtual DbSet<SampleSampleDefinition> SampleDefinition { get; set; }
        public virtual DbSet<SampleSampleGroup> SampleGroup { get; set; }
        public virtual DbSet<SampleSpec> Spec { get; set; }
        public virtual DbSet<SampleTestDefinition> TestDefinition { get; set; }
        public virtual DbSet<SampleTestRelation> TestRelation { get; set; }
        public virtual DbSet<Container> Container { get; set; }
        public virtual DbSet<Requirements> Requirements { get; set; }
        public virtual DbSet<Sampling> Sampling { get; set; }
        public virtual DbSet<WfDefinition> Definition { get; set; }
        public virtual DbSet<WfRuntimeStepSequence> RuntimeStepSequence { get; set; }
        public virtual DbSet<WfRuntimeWorkFlow> RuntimeWorkFlow { get; set; }
        public virtual DbSet<WfStepSequence> StepSequence { get; set; }
        public virtual DbSet<WikiFileManager> WikiFileManager { get; set; }
        public virtual DbSet<WikiLibrary> Library { get; set; }
        public virtual DbSet<WikiPage> Page { get; set; }
        public virtual DbSet<WikiPageComment> PageComment { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Entity<AuditAuditTrail>(entity =>
            {
                entity.ToTable("Audit_AuditTrail");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AuditTime).HasColumnType("datetime");
                entity.Property(e => e.LogTime).HasColumnType("datetime");

                entity.Property(e => e.AuditorId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AuditorName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RemindUserId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RemindUserName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RemindGroupId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RemindGroupName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.EventName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Explain)
                    .HasMaxLength(1000)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RecordId)
                    .HasMaxLength(50)
                    .HasColumnName("RecordID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Snapshot).UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.TableName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.WorkFlowId)
                    .HasMaxLength(50)
                    .HasColumnName("WorkFlowID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<AreaAndLocation>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Common_A__3214EC078402423E");

                entity.ToTable("Common_Env_AreaAndLocation");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Description)
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.EnvMonitoringId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.EnvMonitoringName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.IntervalUnit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Name)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ParentId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RecordTime).HasColumnType("datetime");
                entity.Property(e => e.Type)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<CommonConversionFactor>(entity =>
            {
                entity.ToTable("Common_ConversionFactor");

                entity.Property(e => e.Code)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Factor).HasColumnType("decimal(18, 10)");

                entity.Property(e => e.TargetCode)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<Monitoring>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__tmp_ms_x__3214EC0747E55F30");

                entity.ToTable("Common_Env_Monitoring");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Description)
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.HighHumidity).HasColumnType("decimal(18, 1)");
                entity.Property(e => e.HighTemperature).HasColumnType("decimal(18, 1)");
                entity.Property(e => e.LowHumidity).HasColumnType("decimal(18, 1)");
                entity.Property(e => e.LowTemperature).HasColumnType("decimal(18, 1)");
                entity.Property(e => e.Name)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Type)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<MonitoringRecord>(entity =>
            {
                entity.ToTable("Common_Env_MonitoringRecord");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AreaAndLocationId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.HumStatus)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Humidity).HasColumnType("decimal(18, 1)");

                entity.Property(e => e.RecordPersonId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RecordPersonName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RecordTime).HasColumnType("datetime");

                entity.Property(e => e.TemStatus)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Temperature).HasColumnType("decimal(18, 1)");
            });

            modelBuilder.Entity<CommonGlobal>(entity =>
            {
                entity.HasKey(e => e.KeyName);

                entity.ToTable("Common_Global");

                entity.Property(e => e.KeyName)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.KeyValue)
                    .IsRequired()
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<CommonGroupUser>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Common_G__3214EC07E39C9FCE");

                entity.ToTable("Common_GroupUser");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.GroupId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.UserId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<Remind>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Common_R__3214EC074BEDE511");

                entity.ToTable("Common_Remind");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Content).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Title)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.WorkFlowId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CreateTime).HasColumnType("datetime");
                entity.Property(e => e.GroupId).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ReadTime).HasColumnType("datetime");
                entity.Property(e => e.ReadUserId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SendRemindId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SendRemindName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.UserId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.UserName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<CommonSiteGroup>(entity =>
            {
                entity.ToTable("Common_SiteGroup");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .HasColumnName("Id")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Site)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.WorkGroup)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<CommonStorageCondition>(entity =>
            {
                entity.HasKey(e => e.ConditionName);

                entity.ToTable("Common_StorageConditions");

                entity.Property(e => e.ConditionName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Humidity)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.IntervalUnit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Iuminosity)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.MaxTemperature)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.MinTemperature)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Other)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.StdTemperature)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<CommonSupplier>(entity =>
            {
                entity.HasKey(e => e.SupplierId);

                entity.ToTable("Common_Supplier");

                entity.Property(e => e.SupplierId)
                    .HasMaxLength(50)
                    .HasColumnName("SupplierID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Address1)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Address2)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.City)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ContactTelephone)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Contacts)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Email)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Fax)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Nation)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Note)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Province)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SupplierCode)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SupplierName)
                    .IsRequired()
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SupplierType)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Telephone)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Website)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ZipCode)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<CommonUnit>(entity =>
            {
                entity.HasKey(e => e.Code);

                entity.ToTable("Common_Units");

                entity.Property(e => e.Code)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ChineseName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.EnglishName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Type)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<CommonUploadFile>(entity =>
            {
                entity.ToTable("Common_UploadFile");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CreateById)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CreateByName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Domain)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.DomainId)
                .IsRequired()
                .HasMaxLength(50)
                .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.FileName)
                    .IsRequired()
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.FileType)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.FileSize)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.UploadTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<CommonUser>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Common_U__3214EC073BF83E93");

                entity.ToTable("Common_User");

                entity.Property(e => e.Id).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Address)
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.DateOfBirth).HasColumnType("date");
                entity.Property(e => e.EmploymentDate).HasColumnType("date");
                entity.Property(e => e.Education)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.EducationalBackground).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Email)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.FullName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Head)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.IdentityName)
                    .HasMaxLength(256)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.JobTitle)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Major)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Nation)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.NativePlace)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PhoneNumber)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Politic)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SelfIntroduction).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Sex)
                    .HasMaxLength(2)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Signature)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SkillCertificate).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Rewards).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.WentToSchool)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.WorkExperience).UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<EqEquipment>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__tmp_ms_x__3214EC07F7E10C2A");

                entity.ToTable("EQ_Equipment");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Group)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Manufacturer)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Model)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Site)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Status)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SupplierId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SupplierName)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.FactoryNumber)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.InstallationLocation)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Type)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ResponsiblePersonId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ResponsiblePerson)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.EnablingDate).HasColumnType("datetime");
                entity.Property(e => e.PurchaseDate).HasColumnType("datetime");
            });

            modelBuilder.Entity<EqEquipmentInfo>(entity =>
            {
                entity.HasKey(e => e.EquipmentId).HasName("PK__EQ_Equip__34474479248622C1");

                entity.ToTable("EQ_EquipmentInfo");

                entity.Property(e => e.EquipmentId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<EqMaintain>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__EQ_Maint__3214EC07A72A6FA4");

                entity.ToTable("EQ_Maintain");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Description)
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.EndTime).HasColumnType("datetime");
                entity.Property(e => e.EqId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS")
                    .HasColumnName("EQID");
                entity.Property(e => e.MaintainEventId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PersonId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PersonName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RecordTime).HasColumnType("datetime");
                entity.Property(e => e.StarTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<EqMaintainEvent>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__EQ_Maint__3214EC07982C63BA");

                entity.ToTable("EQ_MaintainEvent");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Description)
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.EqId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS")
                    .HasColumnName("EQID");
                entity.Property(e => e.EventsName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.FrequencyUnit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.LastTime).HasColumnType("datetime");
                entity.Property(e => e.NextTime).HasColumnType("datetime");
                entity.Property(e => e.SendToGroup)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SendToGroupId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SendToPersonId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SendToPerson)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Status)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<EqUsageRecord>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__tmp_ms_x__3214EC0754E0CBB5");

                entity.ToTable("EQ_UsageRecord");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.FileID)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Duration).HasColumnType("numeric(18, 1)");
                entity.Property(e => e.EndTime).HasColumnType("datetime");
                entity.Property(e => e.RecordTime)
                    .IsRequired()
                    .HasColumnType("datetime");
                entity.Property(e => e.EqId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS")
                    .HasColumnName("EQID");
                entity.Property(e => e.EqName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS")
                    .HasColumnName("EQName");
                entity.Property(e => e.EqType)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS")
                    .HasColumnName("EQType");
                entity.Property(e => e.Note)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PersonId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PersonName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.StartTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<Inventory>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__tmp_ms_x__3214EC07F36F3677");

                entity.ToTable("INV_Inventory");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.AvailableQuantity).HasColumnType("decimal(18, 5)");
                entity.Property(e => e.AvailableUnit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CancelDate)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CurrentWorkFlow)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.DisposalInstructions)
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.EntryId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Identification)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.InDate).HasColumnType("datetime");
                entity.Property(e => e.InventoryNumber)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MaterialCode)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MaterialName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MergeDate)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MergePerson)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MergePersonId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MergeTo)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.NextWorkFlow)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Note)
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.OperatorId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS")
                    .HasColumnName("OperatorID");
                entity.Property(e => e.OperatorName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PositionId)
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.EntryQuantity).HasColumnType("decimal(18, 5)");
                entity.Property(e => e.UnitPrice).HasColumnType("decimal(18, 2)");
                entity.Property(e => e.TotalPrice).HasColumnType("decimal(18, 2)");
                entity.Property(e => e.ReceivedQuantity).HasColumnType("decimal(18, 5)");
                entity.Property(e => e.EntryUnit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Status)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.StorageConditions)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Vld)
                    .HasColumnType("datetime")
                    .HasColumnName("vld");
                entity.Property(e => e.WorkFlowId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<InventoryEx>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__tmp_ms_x__3214EC07D06D0FEA");

                entity.ToTable("INV_InventoryEx");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ArticleNumber)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.InventoryId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Model)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Specifications)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SupplierBatchNumber)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SupplierId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS")
                    .HasColumnName("SupplierID");
                entity.Property(e => e.SupplierName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<Material>(entity =>
            {
                entity.HasKey(e => e.Code).HasName("PK__tmp_ms_x__A25C5AA6D4F2FADA");

                entity.ToTable("INV_Material");

                entity.Property(e => e.Code)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.EquipmentId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS")
                    .HasColumnName("EquipmentID");
                entity.Property(e => e.EquipmentType)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Note)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RemindGroup)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RemindGroupId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RemindPerson)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RemindPersonId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Type1)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Type2)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<UseInventory>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__INV_UseI__3214EC07E436DCD0");

                entity.ToTable("INV_UseInventory");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.DoMainId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.DoMainName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.OutInventoryId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MaterialCode)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MaterialName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Note)
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Quantity).HasColumnType("numeric(18, 5)");
                entity.Property(e => e.Unit)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.UseDateTime).HasColumnType("datetime");
                entity.Property(e => e.UseId)
                    .HasMaxLength(10)
                    .IsFixedLength()
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.UseName)
                    .IsRequired()
                    .HasMaxLength(10)
                    .IsFixedLength()
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<Component>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__tmp_ms_x__3214EC074F7ED68D");

                entity.ToTable("Reagent_Components");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Concentration)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Dosage).HasColumnType("decimal(18, 5)");
                entity.Property(e => e.DosageUnit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MaterialCode)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MaterialName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Name)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PreparationMethod).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ReagentId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<Reagents>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Reagent___3214EC07A4094176");

                entity.ToTable("Reagent_Reagents");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.AdoptionStandard)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Concentration)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MaterialCode)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MaterialName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Name)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Number)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RemindUserId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RemindUserName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RemindGroupId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RemindGroupName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PreparationMethod).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PreparationQuantity).HasColumnType("decimal(18, 5)");
                entity.Property(e => e.QuantityUnit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Type)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ValidityUnit)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<Record>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__tmp_ms_x__3214EC078F0383F2");

                entity.ToTable("Reagent_Record");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ReagentId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Concentration)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Humidity).HasColumnType("decimal(18, 1)");
                entity.Property(e => e.HumidityUnit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.InventoryId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MaterialCode)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.MaterialName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Name)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Number)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RemindUserId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RemindGroupId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PreparationById)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PreparationByName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PreparationQuantity).HasColumnType("decimal(18, 5)");
                entity.Property(e => e.PreparationTime).HasColumnType("datetime");
                entity.Property(e => e.QuantityUnit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Temperature).HasColumnType("decimal(18, 1)");
                entity.Property(e => e.TemperatureUnit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Type)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Status)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ValidityTo).HasColumnType("datetime");
            });

            modelBuilder.Entity<SampleAnalyte>(entity =>
            {
                entity.ToTable("Sample_Analytes");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Classification)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Code)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.DefaultValue)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.DefaultSpecId)
                    .HasMaxLength(50)
                    .HasColumnName("DefaultSpecID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.DefaultSpecName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.English)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.EqType)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ResultModel)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RoundingOff)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Units)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.FUnits)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.UnitsType)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.DetectionLimit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AlternativeResults)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.MethodId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.MethodCode)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<SampleLoginRelation>(entity =>
            {
                entity.ToTable("Sample_LoginRelation");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AnalyteId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.MethodId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SampleId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SpecCollectionId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.TestId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<SampleMethod>(entity =>
            {
                entity.ToTable("Sample_Method");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Code)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.EffectiveDate).HasColumnType("datetime");

                entity.Property(e => e.ExpireDate).HasColumnType("datetime");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Type)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Version)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RecordSheet)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Status)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<SampleRelation>(entity =>
            {
                entity.ToTable("Sample_Relation");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.IncludedId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("IncludedID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.IncludedTabName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SourceId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("SourceID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SourceTabName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<SampleResult>(entity =>
            {
                entity.ToTable("Sample_Results");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AcceptanceCriteria)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AcceptanceRules)
                .HasMaxLength(50)
                .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CalculationRules)
                .HasMaxLength(50)
                .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AcceptanceText)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AnalytesCode)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AnalytesId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("AnalytesID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AnalytesEnglish)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AnalytesName)
                    .IsRequired()
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Conclusion)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.EntryModel)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.EntryPersonId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.EntryPersonName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.EntryTime).HasColumnType("datetime");

                entity.Property(e => e.EqUsageRecordId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.EqId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.EqType)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Final)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.HighA)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.HighB)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.LowA)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.LowB)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.StandardValue)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Original)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.OriginalFinal)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.MethodId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.MethodCode)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ResultModel)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RoundingOff)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SampleId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("SampleID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Status)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.TestId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.TestName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Units)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.FUnits)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.DetectionLimit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AlternativeResults)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<RetentionConfig>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Sample_R__3214EC0715C885F4");

                entity.ToTable("Sample_RetentionConfig");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Container)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.DurationUnit)
                    .HasMaxLength(50)
                    .IsFixedLength()
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Name)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Position).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Quantity).HasColumnType("decimal(18, 5)");
                entity.Property(e => e.StorageConditions).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Unit)
                    .HasMaxLength(50)
                    .IsFixedLength()
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<RetentionSample>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__tmp_ms_x__3214EC07DB120B3C");

                entity.ToTable("Sample_RetentionSample");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.BatchId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Classification)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Container)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.DisposalInstructions).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.DisposerId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.DisposerName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.DisposerTime)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.GenricClass)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Group)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.KeepTo).HasColumnType("date");
                entity.Property(e => e.MaterialCode)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Name)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Note).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Position).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Quantity).HasColumnType("numeric(18, 5)");
                entity.Property(e => e.ReceptionTime).HasColumnType("datetime");
                entity.Property(e => e.RecipientId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RecipientName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RegistrationTime).HasColumnType("datetime");
                entity.Property(e => e.SampleId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SampleNumber)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Site)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.StorageConditionsId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Unit)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<RetentionUse>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Sample_R__3214EC072D41B5F6");

                entity.ToTable("Sample_RetentionUse");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Note).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Quantity).HasColumnType("decimal(18, 5)");
                entity.Property(e => e.RetentionSampleId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SampleId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Unit)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.UseDateTime).HasColumnType("datetime");
                entity.Property(e => e.UserId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.UserName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<SampleSample>(entity =>
            {
                entity.ToTable("Sample_Sample");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AssignGroupId)
                    .HasMaxLength(50)
                    .HasColumnName("AssignGroupID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AssignGroupName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AssignPersonId)
                    .HasMaxLength(50)
                    .HasColumnName("AssignPersonID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AssignPersonName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.BatchId)
                    .HasMaxLength(50)
                    .HasColumnName("BatchID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Classification)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CompleteTime).HasColumnType("datetime");

                entity.Property(e => e.CurrentWorkFlow)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.GenricClass)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Group)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.InventoryId)
                    .HasMaxLength(50)
                    .HasColumnName("InventoryID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.LoginPersonId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("LoginPersonID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.LoginPersonName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.LoginTime).HasColumnType("datetime");

                entity.Property(e => e.SkipSequence).UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.MaterialId)
                    .HasMaxLength(50)
                    .HasColumnName("MaterialID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.NextWorkFlow)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SampleId)
                    .HasMaxLength(50)
                    .HasColumnName("SampleID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SampleNumber)
                    .HasMaxLength(50)
                    .HasColumnName("SampleNumber")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SamplingPoint)
                    .HasMaxLength(200)
                    .HasColumnName("SamplingPoint")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Site)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Status)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.WorkFlowId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("WorkFlowID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ReportName)
                    .HasMaxLength(200)
                    .HasColumnName("ReportName")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RetentionConfigId)
                    .HasMaxLength(50)
                    .HasColumnName("RetentionConfigId")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<SampleSampleBatch>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Sample_S__3214EC07B4776502");

                entity.ToTable("Sample_SampleBatch");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.BatchId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CreatTime).HasColumnType("datetime");
                entity.Property(e => e.Ex1)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Ex2)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Ex3)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PersonId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PersonName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SendDepartment)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SendPerson)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.SendTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<SampleSampleDefinition>(entity =>
            {
                entity.ToTable("Sample_SampleDefinition");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Classification)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SkipSequence).UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.GenricClass)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Group)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.MaterialId)
                    .HasMaxLength(50)
                    .HasColumnName("MaterialID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ReportName)
                    .HasMaxLength(200)
                    .HasColumnName("ReportName")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SamplingPoint)
                    .HasMaxLength(200)
                    .HasColumnName("SamplingPoint")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Site)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.WorkFlowId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("WorkFlowID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.WorkFlowName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("WorkFlowName")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.DefaultNumber)
                    .HasMaxLength(50)
                    .HasColumnName("DefaultNumber")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RetentionConfigId)
                    .HasMaxLength(50)
                    .HasColumnName("RetentionConfigId")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

            });

            modelBuilder.Entity<SampleSampleGroup>(entity =>
            {
                entity.ToTable("Sample_SampleGroup");

                entity.Property(e => e.Id)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Group)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Name)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Type)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Site)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SampleId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SampleGroupId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<SampleSpec>(entity =>
            {
                entity.ToTable("Sample_Spec");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AcceptanceCriteria)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AcceptanceRules)
                .HasMaxLength(50)
                .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AnalyteId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Code)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CollectionId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.FirstGroup)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.HighA)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.HighB)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.LowA)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.LowB)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.StandardValue)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Name)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ReleaseStatus)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SecondGroup)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<SampleTestDefinition>(entity =>
            {
                entity.ToTable("Sample_TestDefinition");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.FirstGroup)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ReleaseStatus)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SecondGroup)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.TestName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<SampleTestRelation>(entity =>
            {
                entity.ToTable("Sample_TestRelation");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AnalytesId)
                    .HasMaxLength(50)
                    .HasColumnName("AnalytesID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CalculationRules)
                .HasMaxLength(50)
                .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.MethodId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SpecCollectionId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.TestDefinitionId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("TestDefinitionID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<Container>(entity =>
            {
                entity.ToTable("SPL_Container");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Capacity).HasColumnType("decimal(18, 2)");

                entity.Property(e => e.Code)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Model)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Specifications)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SubContainerId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SupplierId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SupplierName)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Type)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.UnitCode)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<Requirements>(entity =>
            {
                entity.ToTable("SPL_Requirements");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ContainerId)
                    .HasMaxLength(50)
                    .HasColumnName("ContainerID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ContainerName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.MaterialCode)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SendTo)
                    .HasMaxLength(200)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.StorageEnvironment)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Type)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.UnitCode)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Volume).HasColumnType("decimal(18, 2)");
            });

            modelBuilder.Entity<Sampling>(entity =>
            {
                entity.ToTable("SPL_Sampling");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.InventoryId)
                    .HasMaxLength(50)
                    .HasColumnName("InventoryID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RequirementsId)
                    .HasMaxLength(50)
                    .HasColumnName("RequirementsID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SamplingPersonId)
                    .IsRequired()
                    .HasMaxLength(10)
                    .IsFixedLength(true)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SamplingPersonName)
                    .IsRequired()
                    .HasMaxLength(10)
                    .IsFixedLength(true)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SamplingPointId)
                    .HasMaxLength(50)
                    .HasColumnName("SamplingPointID")
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SamplingTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<WfDefinition>(entity =>
            {
                entity.ToTable("WF_Definition");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CreatTime).HasColumnType("datetime");

                entity.Property(e => e.CreatorId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Name)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Type)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

            });

            modelBuilder.Entity<WfRuntimeStepSequence>(entity =>
            {
                entity.ToTable("WF_RuntimeStepSequence");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AdditionalData).UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AdditionalType)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.BranchName)
                    .HasMaxLength(1000)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CurrentHandlerId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CurrentHandlerType)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.HandlingTime).HasColumnType("datetime");

                entity.Property(e => e.NextId)
                    .HasMaxLength(1000)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.PreviousId)
                    .HasMaxLength(1000)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.RecordTime).HasColumnType("datetime");

                entity.Property(e => e.RuntimeWorkFlowId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Status)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.StepName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.StepSequenceId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.StepType)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Suggestion).UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<WfRuntimeWorkFlow>(entity =>
            {
                entity.ToTable("WF_RuntimeWorkFlow");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.AssemblyName)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.CreaterId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CreaterType)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.DefinitionId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.DomainId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.DomainName)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.NameSpace)
                    .HasMaxLength(150)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Status)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.UpdataTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<WfStepSequence>(entity =>
            {
                entity.ToTable("WF_StepSequence");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.ConvergencePoint)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CurrentHandlerId)
                    .HasMaxLength(1000)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.CurrentHandlerType)
                    .HasMaxLength(500)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.DefinitionId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.Description)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.JudgmentConditions)
                    .HasMaxLength(500)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.NextId)
                    .HasMaxLength(1000)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.PreviousId)
                    .HasMaxLength(1000)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.StepName)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.StepType)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");

                entity.Property(e => e.SubProcess)
                    .HasMaxLength(1000)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<WikiFileManager>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Wiki_Fil__3214EC078A51798A");

                entity.ToTable("Wiki_FileManager");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.TextId)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CreatorId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CreatorName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CreatorTime).HasColumnType("datetime");
                entity.Property(e => e.DraftedBy)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.DraftedDate)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.EffectiveDate)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.FileName)
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.FileNumber)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ParentDirectory).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Revise)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Year)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<WikiLibrary>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Wiki_Lib__3214EC0776588EB7");

                entity.ToTable("Wiki_Library");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CreateUserId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CreateUserName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ParentDirectory).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RecordTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<WikiPage>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Wiki_Pag__3214EC07019748E5");

                entity.ToTable("Wiki_Page");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.AssociatedFileId).UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CreatorId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CreatorName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.ParentDirectory)
                    .IsRequired()
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RecordTime).HasColumnType("datetime");
                entity.Property(e => e.TextContent)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Title)
                    .IsRequired()
                    .HasMaxLength(100)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
            });

            modelBuilder.Entity<WikiPageComment>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PK__Wiki_Pag__3214EC073EC84E91");

                entity.ToTable("Wiki_PageComment");

                entity.Property(e => e.Id)
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.Comment)
                    .IsRequired()
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CreatorId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.CreatorName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.PageId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .UseCollation("SQL_Latin1_General_CP1_CI_AS");
                entity.Property(e => e.RecordTime).HasColumnType("datetime");
            });

            OnModelCreatingPartial(modelBuilder);
        }
        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
